<template>
	<view class="box">
		<view class="tab">
			<view :class="current === 1 ? 'tab-item tab-item-ac' : 'tab-item'" @click="setCurrent(1)">
				简介海报
			</view>
			<view :class="current === 0 ? 'tab-item tab-item-ac' : 'tab-item'" @click="setCurrent(0)">
				分享样式
			</view>
		</view>
		<view class="content" v-if="id > 0">
			<Share v-if="current === 0" ref="ShareRef" :businessCardId="id"/>
			<Hb v-else ref="HbRef" :businessCardId="id" :circle_id="circle_id"/>
		</view>
	</view>
</template>

<script>
	import Share from './page/share/share.vue'
	import Hb from './page/hb/hb.vue'
	import {
		InformationPublishLog
	} from '@/common/http/api.js'
	export default {
		components:{
			Share,Hb
		},
		data() {
			return {
				current: 1,
				id:'',
				circle_id: ''
			};
		},
		onLoad(e){
			this.id = e.id
			this.circle_id = e.circle_id
		},
		onShow() {
			if(this.current === 0) {
				//this.$refs.ShareRef.init()
			} else {
				this.$refs.HbRef.init()
			}
			
			
		},
		methods:{
			setCurrent(e){
				this.current = e;
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #F6F7F8;
	}
	.box {
		padding-top: 30rpx;
		padding-bottom: 30rpx;
	}
	.tab{
		width: 690rpx;
		height: 144rpx;
		background: #FFFFFF;
		border-radius: 20rpx;
		margin: 0 auto;
		display: flex;
		align-items: center;
		justify-content: space-around;
		.tab-item {
			width: 265rpx;
			height: 71rpx;
			border-radius: 35rpx;
			border: 1px solid #7C7C7C;
			display: flex;
			align-items: center;
			justify-content: center;
			font-family: PingFang SC;
			font-weight: 500;
			font-size: 28rpx;
			color: #131313;
		}
		.tab-item-ac {
			background: #12B475;
			color: #FFFFFF;
			border: 0px solid #7C7C7C;
		}
	}
</style>
